package com.itheima.service.impl;

import com.github.pagehelper.PageHelper;
import com.itheima.dao.OrdersDao;
import com.itheima.domain.Orders;
import com.itheima.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class OrdersServiceImpl implements OrdersService {
    @Autowired
    private OrdersDao ordersDao;
    /*
    查询
     */
    @Override
    public List<Orders> findAll(int page ,int size) {
        PageHelper.startPage(page , size);
        return ordersDao.findAll();
    }

    /*
    订单详情
     */
    @Override
    public Orders findById(String ordersId) {
        return ordersDao.findById( ordersId );
    }
}
